package com.gurid.service.base.exception;

import com.gurid.common.base.result.ResultCode;
import lombok.Data;

@Data
public class GuridException extends RuntimeException{

    private Integer code;

    public GuridException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public GuridException(ResultCode resultCode){
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }

    @Override
    public String toString() {
        return "GuliException{" +
                "code" + code +
                ", message" + this.getMessage() +
                "}";
    }
}
